#include "FxChessDown.h"

FxChessDown::FxChessDown(void)
{
}


FxChessDown::~FxChessDown(void)
{
}

void FxChessDown::AddParticle(float _posX, float _posY, float _posZ)
{
	Vector3 _origin(_posX, _posY, _posZ);
	m_twis.push_back(new FxTwist(_origin));
	m_eclip.push_back(new FxEclipse(_origin));
	
}

void FxChessDown::Update(float _dt)
{
	for(int i = 0; i < m_twis.size(); i++)
	{
		FxTwist *t = m_twis[i];
		if(t->m_isDeath == true) 
			m_twis.erase(m_twis.begin() + i);
		else
			t->Update(_dt);
	}
	for(int i = 0; i < m_eclip.size(); i++)
	{
		FxEclipse *e = m_eclip[i];
		if(e->isDeath == true) 
			m_eclip.erase(m_eclip.begin() + i);
		else
			e->Update(_dt);
	}
}
void FxChessDown::Draw(float _posX, float _posY, float _posZ, 
					   float _viewX, float _viewY, float _viewZ)
{
	for(int i = 0; i < m_twis.size(); i++)
	{
		FxTwist *t = m_twis[i];
		t->Draw(_posX, _posY, _posZ, _viewX, _viewY, _viewZ);
	}
	for(int i = 0; i < m_eclip.size(); i++)
	{
		FxEclipse *t = m_eclip[i];
		t->Draw(_posX, _posY, _posZ, _viewX, _viewY, _viewZ);
	}
}
void FxChessDown::Delete()
{
	m_eclip.clear();
	m_twis.clear();
}

